/*
*Copyright 2021-2023 NERCIS
*
*Licensed under the Apache License, Version 2.0 (the "License");
*you may not use this file except in compliance with the License.
*You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*Unless required by applicable law or agreed to in writing, software
*distributed under the License is distributed on an "AS IS" BASIS,
*WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*See the License for the specific language governing permissions and
*limitations under the License.
*/

package cn.ac.nercis.pes.repository.mapper.knowledge;

import cn.ac.nercis.pes.model.dto.knowledge.KmRiskDefinitionDTO;
import cn.ac.nercis.pes.model.dto.knowledge.KmRiskDescDTO;
import cn.ac.nercis.pes.model.dto.knowledge.KmSuggestDTO;
import cn.ac.nercis.pes.model.dto.knowledge.KmVulnerabilityDescDTO;
import cn.ac.nercis.pes.repository.model.knowledge.KmRiskDefinitionDO;
import cn.ac.nercis.pes.repository.model.knowledge.KmRiskDescDO;
import cn.ac.nercis.pes.repository.model.knowledge.KmSuggestDO;
import cn.ac.nercis.pes.repository.model.knowledge.KmVulnerabilityDescDO;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

/**
 * 基础通用信息实体类（知识库）类型映射
 *
 * @author zpy
 * @version 1.0.01
 */
@Mapper(componentModel = "spring",
        unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface KmCommonMapper {
    KmCommonMapper INSTANCE = Mappers.getMapper(KmCommonMapper.class);

    KmRiskDefinitionDTO toDTO(KmRiskDefinitionDO entity);
    KmRiskDefinitionDO toDO(KmRiskDefinitionDTO dto);

    KmRiskDescDTO toDTO(KmRiskDescDO entity);
    KmRiskDescDO toDO(KmRiskDescDTO dto);

    KmSuggestDTO toDTO(KmSuggestDO entity);
    KmSuggestDO toDO(KmSuggestDTO dto);

    KmVulnerabilityDescDTO toDTO(KmVulnerabilityDescDO entity);
    KmVulnerabilityDescDO toDO(KmVulnerabilityDescDTO dto);

}